<template>
    <submenu v-if="data.children && data.children.length" :index="data.index">
        <template slot="title">
            <span>{{data.title}}</span>
        </template>
        <demo-item v-for="item in data.children" :key="item.index" :data="item"></demo-item>
    </submenu>
    <menu-item v-else :index="data.index">
        <p slot="content">{{data.title}}</p>
    </menu-item>
</template>

<script>
import demoItem from './demoItem.vue';
export default {
    name: 'demoItem',
    components: {demoItem},
    props: ['data']
}
</script>
